<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var str='asdagfxgbcxvawfsagdgffjfd'
    var str1=str.split('')
    var count=0;
    for(i=0;i<str1.length;i++){
        if(str1.indexOf(str1[i])){
            count++
        }
        
    }
    console.log(str1);
    console.log(count);
    
    
</script>